#!/bin/bash
################################
#以下为openstack高可用相关的配置

#haproxy设置……所有controller节点
echo '#RabbitMQ
listen RabbitMQ-Server
bind controller:5673
mode tcp
balance roundrobin
option tcpka
timeout client  3h
timeout server  3h
option          clitcpka
server controller1 controller1:5672 check inter 5s rise 2 fall 3
server controller2 controller2:5672 check inter 5s rise 2 fall 3
server controller3 controller3:5672 check inter 5s rise 2 fall 3

listen RabbitMQ-Web
bind controller:15673
mode tcp
balance roundrobin
option tcpka
server controller1 controller1:15672 check inter 5s rise 2 fall 3
server controller2 controller2:15672 check inter 5s rise 2 fall 3
server controller3 controller3:15672 check inter 5s rise 2 fall 3
'>>/etc/haproxy/haproxy.cfg
systemctl restart haproxy.service
sleep 3
netstat -antp|grep 567